feat: Adding a fault stability analysis workflow#232
feat: Adding a fault stability analysis workflow#232paloma-martinez wants to merge 13 commits intomainfrom
Conversation
RomainBaville
left a comment
There was a problem hiding this comment.
Thanks for the job.
I made some suggestion but I have two additionnal global comment:
There is some caracter in the code that can lead to issues (greek letters, emoticon, arrows). To avoid that, you may change them.
In your code, some warning can be convert to error and the error managment can be updated (raise and not log error, use the CountVerbosityHandler ...)
geos-mesh/src/geos/mesh/io/vtkIO.py
Outdated
| outputDir (str): Output directory | ||
| outputFiles (list[tuple[int, str]]): List containing all the filenames of the PVD files | ||
| """ | ||
| pvdPath = os.path.join( outputDir, 'fault_analysis.pvd' ) |
There was a problem hiding this comment.
You may add as an argument the new file name path
| dict[str, Any]: Dictionary containing local stress, normal stress, shear stress and strike and shear dip. | ||
| """ | ||
| # Verify orthonormality | ||
| assert np.abs( np.linalg.norm( tangent1 ) - 1.0 ) < 1e-10, f"T1 - {np.abs( np.linalg.norm( tangent1 ) - 1.0 )}" |
There was a problem hiding this comment.
Instead of using assert, you may raise error if the condition is not verified
|
|
||
| These methods include: | ||
| - filling partial VTK arrays with values (useful for block merge) | ||
| - creation of new VTK array, empty or with a given data array |
There was a problem hiding this comment.
| - creation of new VTK array, empty or with a given data array | |
| - modification of the value of a VTK array |
|
|
||
| def computeNormals( | ||
| surface: vtkPolyData, | ||
| pointNormals: bool = False, |
There was a problem hiding this comment.
Why have you add pointNormals arguments ? It is not used in the function.
| """Extract surface from an input mesh. | ||
|
|
||
| Args: | ||
| mesh: Input mesh |
There was a problem hiding this comment.
| mesh: Input mesh | |
| mesh (vtkUnstructuredGrid): Input mesh |
| # COMPUTE SCU ANALYTICALLY (Mohr-Coulomb) | ||
| # =================================================================== | ||
| mu = np.tan( np.radians( frictionAngle ) ) | ||
|
|
There was a problem hiding this comment.
Same here for the greek letters
| nUnstable = np.sum( SCUAnalyticalArr >= 1.0 ) | ||
|
|
||
| if nValid > 0: | ||
| self.logger.info( |
There was a problem hiding this comment.
The message needs to be updated to add \n at the end of the line and remove greek letters
| # Generate filename | ||
| vtuFilename = f"principal_stresses_{timestep:05d}.vtu" | ||
| vtuPath = self.vtuOutputDir / vtuFilename | ||
|
|
There was a problem hiding this comment.
self.vtuOutpuDir already contains 'principal_stress'
|
|
||
| pvdPath = self.vtuOutputDir / filename | ||
|
|
||
| self.logger.info( f"\n💾 Creating PVD collection: {pvdPath}" |
There was a problem hiding this comment.
| self.logger.info( f"\n💾 Creating PVD collection: {pvdPath}" | |
| self.logger.info( f"💾 Creating PVD collection: {pvdPath}\n" |
| tree = ElementTree( root ) | ||
| tree.write( str( pvdPath ), encoding='utf-8', xml_declaration=True ) | ||
|
|
||
| self.logger.info( " ✅ PVD file created successfully" |
There was a problem hiding this comment.
Update the message with the '\n' at the end of the line 713, 714 and 715
RomainBaville
left a comment
There was a problem hiding this comment.
Thanks for the job.
I made some suggestion but I have two additionnal global comment:
There is some caracter in the code that can lead to issues (greek letters, emoticon, arrows). To avoid that, you may change them.
In your code, some warning can be convert to error and the error managment can be updated (raise and not log error, use the CountVerbosityHandler ...)
This PR will add a post-processing workflow to analyze the fault stability and plot various results.